body {
  width: 500px;
  height: 550px;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

h1 {
  margin: 0;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.model-selection {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  min-width: 0;
}

.model-selection label {
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
}

#modelSelect {
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  box-sizing: border-box;
  min-width: 0;
  flex: 1;
}

.input-section {
  padding: 12px 15px;
  border-bottom: 1px solid #e1e5eb;
}

#inputText {
  width: 100%;
  min-height: 80px;
  max-height: 120px;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  resize: vertical;
  font-size: 13px;
  box-sizing: border-box;
  margin-bottom: 10px;
}

.custom-instruction {
  position: relative;
  margin-bottom: 10px;
}

.custom-instruction-label {
  display: block;
  margin-bottom: 3px;
  font-weight: 500;
  color: #374151;
  font-size: 12px;
}

#customInstruction {
  width: 100%;
  min-height: 40px;
  max-height: 60px;
  padding: 6px 25px 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  resize: vertical;
  font-size: 12px;
  box-sizing: border-box;
  background-color: #f9fafb;
  transition: all 0.2s ease;
}

#customInstruction:focus {
  outline: none;
  border-color: #4f46e5;
  background-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.custom-instruction-help {
  position: absolute;
  right: 8px;
  top: 22px;
  color: #9ca3af;
  font-size: 11px;
  cursor: help;
}


.button-group {
  display: flex;
  gap: 6px;
}

.operation-btn {
  flex: 1;
  padding: 6px 2px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  background-color: #4f46e5;
  color: white;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.operation-btn:hover {
  background-color: #4338ca;
  transform: translateY(-1px);
}

.operation-btn:active {
  transform: translateY(0);
}

.operation-btn:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

#translateBtn {
  background-color: #10b981;
}

#translateBtn:hover {
  background-color: #059669;
}

#summarizeBtn {
  background-color: #f59e0b;
}

#summarizeBtn:hover {
  background-color: #d97706;
}

#explainBtn {
  background-color: #8b5cf6;
}

#explainBtn:hover {
  background-color: #7c3aed;
}

#customBtn {
  background-color: #ec4899;
}

#customBtn:hover {
  background-color: #db2777;
}

#clearBtn {
  background-color: #ef4444;
  color: white;
}

#clearBtn:hover {
  background-color: #dc2626;
}

.output-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 15px;
  overflow: hidden;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.output-header h2 {
  margin: 0;
  font-size: 14px;
  color: #374151;
}

.status-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.stop-btn {
  padding: 3px 8px;
  background-color: #ef4444;
  color: white;
  border: none;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
}

.stop-btn:hover {
  background-color: #dc2626;
}

.status {
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 3px;
}

.status.processing {
  background-color: #fef3c7;
  color: #92400e;
}

.status.completed {
  background-color: #d1fae5;
  color: #065f46;
}

#outputText {
  flex: 1;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background-color: white;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.4;
  color: #374151;
}

#outputText:empty::before {
  content: "处理结果将显示在这里...";
  color: #9ca3af;
}

/* 响应式优化 */
/* 响应式优化 */
@media (max-width: 500px) {
  .button-group {
    flex-wrap: wrap;
  }
  
  /* .operation-btn {
    flex: 1 1 calc(50% - 6px);
  } */
}